
     /**
      * 功能描述: 如果选中其中的不操作原因的,把不显示的必填字段清零
      */
      function clearValue(obj1,obj2,obj3){
        if(obj1 != undefined){
          $(obj1).value = "";
        }
        if(obj2 != undefined){
          $(obj2).value = "";
        }
        if(obj3 != undefined){
          $(obj3).value = "";
        }
      }
   /**
    * 功能描述：格式化数字
    *@param srcStr表示要格式化的数
    *@param nAfterDot 要保留的位数
	*/
   function FormatNumber(srcStr,nAfterDot){
    var srcStr,nAfterDot;
    var resultStr,nTen;
    srcStr = ""+srcStr+"";
    strLen = srcStr.length;
    dotPos = srcStr.indexOf(".",0);
    if (dotPos == -1){
        resultStr = srcStr+".";
        for (i=0;i<nAfterDot;i++){
            resultStr = resultStr+"0";
        }
        return resultStr;
    } else{
        if ((strLen - dotPos - 1) >= nAfterDot){
            nAfter = dotPos + nAfterDot + 1;
            nTen =1;
            for(j=0;j<nAfterDot;j++){
            nTen = nTen*10;
        }
        resultStr = Math.round(parseFloat(srcStr)*nTen)/nTen;
        return resultStr;
        } else{
            resultStr = srcStr;
            for (i=0;i<(nAfterDot - strLen + dotPos + 1);i++){
                resultStr = resultStr+"0";
            }
            return resultStr;
        }
    }
 }

       /**
        * 功能描述:改变异常选项时,异常说明跟着改变
        * @author 张红丽
        * @param input 下拉框关联的文本框Id
        * @param sel   下拉框
        * @param selectIndex 下拉框选中的项
        */
      function changeSelect(input,sel,selectIndex){
         if(selectIndex > 0){
         $(input).value=$(sel).options[selectIndex].desc;
         $(input).readOnly = true;
         }else{
           $(input).readOnly = true;
           $(input).value ="";

         }
      }

	  /**
	   * 如果选中下拉框,且清除验证
	   * @obj 是否异常信息必填的单选按钮
	   */
      function clearValidate(elm,sel,obj,message){
        if(sel != undefined && sel.selectedIndex > 0){
            if(!obj.checked){
			validationAlert(elm,false);
			return true;
			}
        }
		else if(sel.selectedIndex <= 0){
		    if($(obj).checked){
		    validationAlert(elm,true,message);
		    }
			return false;
		}
      }
      /**
       * 功能描述 ：设置移交物品
       */
       function setHandoverGoods(goodIds,goodNames){
          $('goodIds').value=goodIds;
          $('goods').value=goodNames;
          $('goods').fireEvent('onblur');
          $('handoverDate').focus();
       }


	    /**
        * 功能描述： 设置费用审核人信息 获取焦点和失焦是为是在选择后去掉验证信息
        */
	    function setChangeAssessorInfo(info){

			var temp = info.split(",");
			$('chargeCheckerId').value= temp[0];
			$('chargeChecker').value = temp[1];

			var houseId = $('houseId').value;
			$('chargeChecker').validateUrl = PROJECT_NAME_PATH_MYCE + "/house_proRightModificationAction.do?method=checkExaminer&userId="+temp[0]+"&houseId="+houseId;

			$('chargeChecker').fireEvent("onblur");

       }

	   /**
        * 功能描述： 设置退伙手续审核人信息 获取焦点和失焦是为是在选择后去掉验证信息
        */
	    function setOutAssessorInfo(info){

			var temp = info.split(",");
			$('outCheckerId').value= temp[0];
			$('outChecker').value = temp[1];

			var houseId = $('houseId').value;
			$('outChecker').validateUrl = PROJECT_NAME_PATH_MYCE + "/house_proRightModificationAction.do?method=checkExaminer&userId="+temp[0]+"&houseId="+houseId;

			$('outChecker').fireEvent("onblur");
       }

	  /**
	   * 功能描述: 提交表单
	   */
      function submitForm(form){

		setButtonStatus(false);

         compareTowMeter();

		 var meterReason = $('advice-'+Validation.getElmID($('selectCopyMeterReason')));
		 var checkHouseReason = $('advice-'+Validation.getElmID($('selectCheckHouseReason')));
		 var handoverGoodsReason = $('advice-'+Validation.getElmID($('selectHandoverReason')));


         if(meterReason != null ||checkHouseReason !=null || handoverGoodsReason != null ){
		 	setButtonStatus(true);
           return false;
         }


         if($('handoverGoods0').checked){
           	clearValue('goodIds','goods','handoverDate');
         }
         if($('checkHouse0').checked){
         	clearValue('houseDesc','checker','checkDate');
         }
         if($('readmeter0').checked){
			clearValue('copyMeterWaterReading','copyMeterAmmeterReading','copyTime');
         }

		 var isTrue = $(form).fireEvent("onSubmit");
		 if(isTrue){
       		 $(form).submit();
		}else{
			setButtonStatus(true);
		}
   }


   	function setButtonStatus(status){ //设置按钮状态 true 代表可用 false代表不可用
		$("btn1_62").disabled = !status;
		$("btn1_72").disabled = !status;
	}

   /**
	* 功能描述： 给字符串去掉前后的空格
	*/
	   String.prototype.trim = function()
		{
    		// 用正则表达式将前后空格
    		// 用空字符串替代。
   		 return this.replace(/(^\s*)|(\s*$)/g, "");
	}
